<template>
    <el-dialog
        title="退回供应商"
        :visible.sync="visibleDialog"
        ref="dialog"
        class="dialogContent"
    >
        <el-input
            type="textarea"
            placeholder="请输入退回原因"
            v-model="returnText"
            maxlength="500"
            show-word-limit
            :autosize="{ minRows: 10, maxRows: 6 }"
        >
        </el-input>
        <div slot="footer" class="dialog-footer">
            <el-button size="mini" type="default-mini" @click="handleClose">取 消</el-button>
            <el-button size="mini" type="primary-font-mini" @click="handleSure">确 定</el-button>
        </div>
    </el-dialog>
</template>

<script>
export default {
    name: "returnDialog",
    data() {
        return {
            visibleDialog: false,
            returnText: ""
        }
    },
    methods: {
        handleSure() {
            if (this.returnText == "") {
                this.$message({
                    type: "error",
                    message: "退回原因未填写",
                    ccuiCustom: true,
                    duration: 1500
                });
                return;
            }
            this.$emit("getValue", this.returnText);
            this.visibleDialog = false;
            this.returnText = '';
        },
        handleClose() {
            this.visibleDialog = false;
            this.returnText = '';
        }
    }
}
</script>

<style scoped>

</style>